package com.smt.modules.bus.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.smt.modules.bus.pojo.ProjectSiPojo;
import com.smt.modules.bus.vo.request.ProjectSiReq;
import lombok.Data;

import java.util.Date;

/**
 * @author zhangyi
 * @date 2018/11/21 9:54
 */
@Data
@TableName("bus_local_remote")
public class LocalRemoteEntity {
    @TableId
    private Long id;
    private String localPath;
    private String remote;
    private Long memberId;
    private Long projectId;
    private Integer stageId;
    private Long taskId;
    private Long subTaskId;
    private Date createTime;
    private Long attId;
    @TableField(exist = false)
    private ProjectSiReq projectSiReq;

    public LocalRemoteEntity(String localPath,String remote, Long memberId,ProjectSiReq projectSiReq, Date createTime) {
        this.localPath = localPath;
        this.remote = remote;
        this.memberId = memberId;
        this.projectId = projectSiReq.getProjectId();
        this.stageId = projectSiReq.getStage();
        this.taskId = projectSiReq.getTaskId();
        this.subTaskId = projectSiReq.getSubTaskId();
        this.createTime = createTime;
    }

    public LocalRemoteEntity(String localPath, String remote, Long memberId, Date createTime) {
        this.localPath = localPath;
        this.remote = remote;
        this.memberId = memberId;
        this.createTime = createTime;
    }
}
